home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Magazine / Morphos / GCC / ppc-amigaos / include / powerup / ppcpragmas / disk_pragmas.h < prev    next >
C/C++ Source or Header  |  2000-02-28  |  3KB  |  136 lines

  1. /* Automatically generated header! Do not edit! */
  2.  
  3. #ifndef _PPCPRAGMA_DISK_H
  4. #define _PPCPRAGMA_DISK_H
  5. #ifdef __GNUC__
  6. #ifndef _PPCINLINE__DISK_H
  7. #include <powerup/ppcinline/disk.h>
  8. #endif
  9. #else
  10.  
  11. #ifndef POWERUP_PPCLIB_INTERFACE_H
  12. #include <powerup/ppclib/interface.h>
  13. #endif
  14.  
  15. #ifndef POWERUP_GCCLIB_PROTOS_H
  16. #include <powerup/gcclib/powerup_protos.h>
  17. #endif
  18.  
  19. #ifndef NO_PPCINLINE_STDARG
  20. #define NO_PPCINLINE_STDARG
  21. #endif/* SAS C PPC inlines */
  22.  
  23. #ifndef DISK_BASE_NAME
  24. #define DISK_BASE_NAME DiskBase
  25. #endif /* !DISK_BASE_NAME */
  26.  
  27. #define    AllocUnit(unitNum)    _AllocUnit(DISK_BASE_NAME, unitNum)
  28.  
  29. static __inline BOOL
  30. _AllocUnit(void *DiskBase, long unitNum)
  31. {
  32. struct Caos    MyCaos;
  33.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  34. //    MyCaos.M68kStart    =    NULL;
  35. //    MyCaos.M68kSize        =    0;
  36.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  37. //    MyCaos.PPCStart        =    NULL;
  38. //    MyCaos.PPCSize        =    0;
  39.     MyCaos.d0        =(ULONG) unitNum;
  40.     MyCaos.caos_Un.Offset    =    (-6);
  41.     MyCaos.a6        =(ULONG) DiskBase;    
  42.     return((BOOL)PPCCallOS(&MyCaos));
  43. }
  44.  
  45. #define    FreeUnit(unitNum)    _FreeUnit(DISK_BASE_NAME, unitNum)
  46.  
  47. static __inline void
  48. _FreeUnit(void *DiskBase, long unitNum)
  49. {
  50. struct Caos    MyCaos;
  51.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  52. //    MyCaos.M68kStart    =    NULL;
  53. //    MyCaos.M68kSize        =    0;
  54.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  55. //    MyCaos.PPCStart        =    NULL;
  56. //    MyCaos.PPCSize        =    0;
  57.     MyCaos.d0        =(ULONG) unitNum;
  58.     MyCaos.caos_Un.Offset    =    (-12);
  59.     MyCaos.a6        =(ULONG) DiskBase;    
  60.     PPCCallOS(&MyCaos);
  61. }
  62.  
  63. #define    GetUnit(unitPointer)    _GetUnit(DISK_BASE_NAME, unitPointer)
  64.  
  65. static __inline struct DiskResourceUnit *
  66. _GetUnit(void *DiskBase, struct DiskResourceUnit *unitPointer)
  67. {
  68. struct Caos    MyCaos;
  69.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  70. //    MyCaos.M68kStart    =    NULL;
  71. //    MyCaos.M68kSize        =    0;
  72.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  73. //    MyCaos.PPCStart        =    NULL;
  74. //    MyCaos.PPCSize        =    0;
  75.     MyCaos.a1        =(ULONG) unitPointer;
  76.     MyCaos.caos_Un.Offset    =    (-18);
  77.     MyCaos.a6        =(ULONG) DiskBase;    
  78.     return((struct DiskResourceUnit *)PPCCallOS(&MyCaos));
  79. }
  80.  
  81. #define    GetUnitID(unitNum)    _GetUnitID(DISK_BASE_NAME, unitNum)
  82.  
  83. static __inline LONG
  84. _GetUnitID(void *DiskBase, long unitNum)
  85. {
  86. struct Caos    MyCaos;
  87.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  88. //    MyCaos.M68kStart    =    NULL;
  89. //    MyCaos.M68kSize        =    0;
  90.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  91. //    MyCaos.PPCStart        =    NULL;
  92. //    MyCaos.PPCSize        =    0;
  93.     MyCaos.d0        =(ULONG) unitNum;
  94.     MyCaos.caos_Un.Offset    =    (-30);
  95.     MyCaos.a6        =(ULONG) DiskBase;    
  96.     return((LONG)PPCCallOS(&MyCaos));
  97. }
  98.  
  99. #define    GiveUnit()    _GiveUnit(DISK_BASE_NAME)
  100.  
  101. static __inline void
  102. _GiveUnit(void *DiskBase)
  103. {
  104. struct Caos    MyCaos;
  105.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  106. //    MyCaos.M68kStart    =    NULL;
  107. //    MyCaos.M68kSize        =    0;
  108.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  109. //    MyCaos.PPCStart        =    NULL;
  110. //    MyCaos.PPCSize        =    0;
  111.     MyCaos.caos_Un.Offset    =    (-24);
  112.     MyCaos.a6        =(ULONG) DiskBase;    
  113.     PPCCallOS(&MyCaos);
  114. }
  115.  
  116. #define    ReadUnitID(unitNum)    _ReadUnitID(DISK_BASE_NAME, unitNum)
  117.  
  118. static __inline LONG
  119. _ReadUnitID(void *DiskBase, long unitNum)
  120. {
  121. struct Caos    MyCaos;
  122.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  123. //    MyCaos.M68kStart    =    NULL;
  124. //    MyCaos.M68kSize        =    0;
  125.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  126. //    MyCaos.PPCStart        =    NULL;
  127. //    MyCaos.PPCSize        =    0;
  128.     MyCaos.d0        =(ULONG) unitNum;
  129.     MyCaos.caos_Un.Offset    =    (-36);
  130.     MyCaos.a6        =(ULONG) DiskBase;    
  131.     return((LONG)PPCCallOS(&MyCaos));
  132. }
  133.  
  134. #endif /* SASC Pragmas */
  135. #endif /* !_PPCPRAGMA_DISK_H */
  136.